import request from '../utils/request.js'

// 获取设备基本信息
// export function featchDevicesFacility(query) {
//   return request({
//     url: '/device-mang/devices/list/',
//     method: 'get',
//     params: query
//   })
// }

// 获取设备高级信息
export function featchHighFacility(query) {
  return request({
    url: '/device-mang/devices/adv/list/',
    method: 'get',
    params: query
  })
}

// 获取位置传感器中历史数据波形
export function featchLocationHistory(query) {
  return request({
    url: '/analysis-mang/distance/history/',
    method: 'get',
    params: query
  })
}

// 添加设备基本信息
export function addDevicesFacility(data) {
  return request({
    url: '/device-mang/devices/adv/',
    method: 'post',
    data
  })
}

// 编辑设备基本信息
export function updataDevicesFacility(id, data) {
  return request({
    url: `/device-mang/devices/adv/${id}/`,
    method: 'patch',
    data
  })
}

// 删除设备基本信息
export function deleteDevicesFacility(id) {
  return request({
    url: `/device-mang/devices/adv/${id}/`,
    method: 'delete'
  })
}

// 下载文件

export function exportTemplateLog(query) {
  return request({
    url: '/bms/files/updownload/',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
